#include <stdio.h>
#include "objc-port.h"

@interface FizzBuzz : Object
{
  int count;
}

- (id)init;
- (void)count;

@end

@implementation FizzBuzz

- (id)init
{
  [super init];
  count = 1;
  return self;
}

- (void)count
{
  if (count % 3 == 0)
    if (count % 5 == 0)
      printf("FizzBuzz\n");
    else
      printf("Fizz\n");
  else
    if (count % 5 == 0)
      printf("Buzz\n");
    else
      printf("%d\n", count);
  count++;
}

@end

int
main(int argc, char **argv)
{
  FizzBuzz *fb;
  int i;

  fb = [FizzBuzz new];
  for (i = 0; i < 20; i++)
    [fb count];
  [fb free];

  return 0;
}

